package com.lening.provider.controller.InformationManagement;

import com.lening.common.base.BaseController;
import com.lening.provider.dto.InformationManagement.NewsClassificationDTO;
import com.lening.provider.po.InformationManagement.NewsClassificationPO;
import com.lening.provider.service.InformationManagement.NewsClassificationService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author 刘政华
 * @datetime 2024/6/5 11:29
 * @description 类对象
 */
@Slf4j
@RestController
@RequestMapping("newsClassifications")
public class NewsClassificationController extends BaseController<NewsClassificationPO, NewsClassificationDTO, NewsClassificationService> {

    @Resource
    private NewsClassificationService newsClassificationService;

    @GetMapping("dropdown")
    public List<NewsClassificationDTO> getNewList(@RequestParam(name = "classificationName", required = false) String classificationName){
        List<NewsClassificationDTO> list = newsClassificationService.getByName(classificationName);
        return list;
    }

}
